#include "Mediator.h"

Mediator::Mediator() : obs()
{
}

void Mediator::Register(ObserverIfc *o, MessageType mt)
{
	obs.push_back(Relation(o, mt));
}

void Mediator::Notify(Message m)
{
	for(int i=0;i<obs.size();i++)
		if(obs[i].GetMessageType() == m.GetMessageType())
			obs[i].GetObserver()->Notify(m);
}